﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Gnosis.Alexandria.Data;


namespace Gnosis.Alexandria.Views
{
    public partial class WorkView
        : ViewControlBase
    {
        public WorkView()
        {
            InitializeComponent();
            Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;
        }

        protected ContextMenuStrip WorkContentMenu
        {
            get { return contextMenu; }
        }

        protected override void HandleMessage(IMessageOld message)
        {
            switch (message.Type)
            {
                default:
                    base.HandleMessage(message);
                    break;
            }
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            Controller.Send(this, MessageTypes.RequestMainTabViewNewTab);
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            Controller.Send(this, MessageTypes.RequestMainTabViewCloseTab, this.Name);
        }

        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Controller.Send(this, MessageTypes.RequestSearchViewEdit, new EditRequestData { Source = this.Name });
        }

        private void searchWikipediaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Controller.Send(this, MessageTypes.RequestSearchWikipedia, new SearchRequestData { Source = this.Name });
        }

        private void searchYouTubeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Controller.Send(this, MessageTypes.RequestSearchYouTube, new SearchRequestData { Source = this.Name });
        }

        private void playMediaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Controller.Send(this, MessageTypes.RequestMediaPlayerLoad);
        }

        private void searchAllMusicToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Controller.Send(this, MessageTypes.RequestSearchAllMusicDotCom, new SearchRequestData { Source = this.Name });
        }

        private void searchLyricWikiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Controller.Send(this, MessageTypes.RequestSearchLyricWiki, new SearchRequestData { Source = this.Name });
        }

        private void searchGroovesharkToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Controller.Send(this, MessageTypes.RequestSearchGrooveshark, new SearchRequestData { Source = this.Name });
        }
    }
}
